package com.chilly.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 注解@CrossOrigin解决跨域问题
 * <p>
 * Created by Chilly Cui on 2020/11/18.
 */
//@CrossOrigin(origins = "http://domain2.com", maxAge = 3600)
@RestController
@RequestMapping("/account")
public class CorsController {

    @CrossOrigin(origins = {"http://domain2.com"})
    @GetMapping("/{id}")
    public void retrieve(@PathVariable Long id) {
        System.out.println(id);
    }

    @DeleteMapping("/{id}")
    public void del(@PathVariable Long id){
        System.out.println("del---");
    }

}
